package gui.exit;

import java.awt.Frame;


import javax.swing.JDialog;

public class ExitDialogue extends JDialog implements SetOperation{

	private static final long serialVersionUID = 3704389427762491881L;


	private Mode mode;
	
	public ExitDialogue(Frame owner){
		super(owner,"Quitter?",true);
		setLocationRelativeTo(owner);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		setContentPane(new ExitContainer(this));
		pack();
		mode=Mode.CANCEL;
		setVisible(true);
	}

	public Mode getMode(){
		return mode;
	}


	@Override
	public void QuitWithoutSave() {
		mode=Mode.QUIT_WITHOUT_SAVE;
		dispose();
	}


	@Override
	public void cancel() {
		mode=Mode.CANCEL;
		dispose();
	}


	@Override
	public void saveAndQuit() {
		mode=Mode.SAVE_AND_QUIT;
		dispose();
	}

	
	
}
